package java68_9;

import java.util.InputMismatchException;
import java.util.Scanner;

public class SelectCode3 {
    public static void main(String[] args) {
        Scanner in=  new Scanner(System.in);

        try {
            System.out.println("请输入总课时:");
            int total = in.nextInt();
            System.out.println("再输入科目数:");
            int course=in.nextInt();
            int avg=total/course;
            System.out.println("平均课时是:"+avg);

        }
        catch (InputMismatchException e){
            System.out.println("输入的不是数字"+e);
            e.printStackTrace();//???
        }catch(ArithmeticException e){
            System.out.println("科目数不能是0");
            e.printStackTrace();
        }catch (Exception e){
            System.out.println("其他异常!!!");
            e.printStackTrace();
        }
        finally {
            System.out.println("暑假开始了...");
        }

    }
}
